subtleties

Eric Wilhelm on 2006-03-29T01:59:44

Background:

* I frequently have 20-50 files open in separate windows.

* Vim complains when you ask to edit a file which is already open.

* That's silly. What I really want is to edit the file.

* I've got this wrapper script for gvim that checks to see if the file is open and calls --remote-expr foreground() if it is open. Result: open or not, I say "eedit $filename" and very soon see a window :-)

A couple months ago, this quit working. Not from upgrading gvim. My guess is that it was because of an upgrade to libgtk triggered by installing something with aptitude.

This caused a lot of frustration, because my oh-so-carefully crafted workflow had suffered a large timber in the spokes and I would have to go search the flyout of 20 windows for the file that I wanted to edit.

:-(

Today, I spent a few minutes looking for the cause again and discovered that setting the kde window manager "focus grabbing suppression" from "low" to "off" did the trick! I had not messed with the setting.

So, like I said... subtle. The new version of gtk must have lowered the priority of whatever function gvim's foreground() call called.

P.S. The wrapper is in my /svn/misc somewhere, but I'm not proud enough of it to give you a link.